#ifndef TABCONTROL_H_
#define TABCONTROL_H_

#include <vector>
#include "wx/wxprec.h"
#include "wx/setup.h"
 
#ifdef __BORLANDC__
    #pragma hdrstop
#endif


#ifndef WX_PRECOMP
    #include "wx/wx.h"
#endif

#include "Tab.h"

namespace Impp
{

class TabControl : public wxPanel
{
private:
	std::vector<Tab*> tabs;
	size_t activeTab;
	size_t maxOffset;
	size_t offset;
	wxColor highlightTop;
	wxColor highlightMiddle;
	wxColor highlightBottom;
	wxColor normalTop;
	wxColor normalMiddle;
	wxColor normalBottom;
	wxColor bgTop;
	wxColor bgMiddle;
	wxColor bgBottom;
	
public:
	TabControl(wxWindow* parent, long id);
	virtual ~TabControl();
	

	void paintEvent(wxPaintEvent& evt);
	void OnEraseBackground(wxEraseEvent& event);
	void onMouseDown(wxMouseEvent & event);
	
	void addTab(Tab* tab);
	void closeTab(size_t tab);
	
	size_t getTabByPos(const wxPoint & pos);

private:
	void tabChanged(int tab);
	
private:
	DECLARE_EVENT_TABLE()

};

}

#endif /*TABCONTROL_H_*/
